//2009/08/04 21:45:08
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

class Intersect
{
public:
    struct node
    {
        int xx; int yy;
    };
    int area(vector <int> x, vector <int> y)
    {
        node a;
        a.xx = min(x[0], x[1]);
        a.yy = min(y[0], y[1]);
        node b;
        b.xx = max(x[0], x[1]);
        b.yy = max(y[0], y[1]);
        for (int i=0; i<x.size(); i+=2)
        {
            node c;
            c.xx = min(x[i], x[i+1]);
            c.yy = min(y[i], y[i+1]);
            node d;
            d.xx = max(x[i], x[i+1]);
            d.yy = max(y[i], y[i+1]);
            a.xx = max(a.xx, c.xx);
            a.yy = max(a.yy, c.yy);
            b.xx = min(b.xx, d.xx);
            b.yy = min(b.yy, d.yy);
        }
        if (a.xx > b.xx || a.yy > b.yy) return 0;
        return (b.xx - a.xx) * (b.yy - a.yy);
    }
};
